<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<jsp:include page="menu.jsp" />
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="css/my.css" />
</head>
<body>
<h1 class="title">用户信息</h1>
<form action="updateuserinfo" method="post">
    <table>
        <tr>
            <td>账号</td>
            <td><input type="text" name="username" value="${userinfo.username}" disabled="disabled" /></td>
            <td>用户名不能为空！</td>
        </tr>
        <tr>
            <td><input type="hidden" name="tusername" value="lisi" /></td>
        </tr>

        <tr>
            <td>Email</td>
            <td><input type="text" name="email" value="${userinfo.email}" /></td>
            <td>邮箱格式不正确！</td>
        </tr>
        <tr>
            <td>性别</td>
            <td colspan="2" style="text-align: left;">
                <input type="radio" name="sex" value="1" ${userinfo.gender==1?'checked':''}/>男
                <input type="radio" name="sex" value="0" ${userinfo.gender==0?'checked':''}/>女</td>
        </tr>
        <tr>
            <td>关注类型</td>
            <td colspan="2">
                <input type="checkbox" name="type" value="法律规定" checked="checked"/>法律规定
                <input type="checkbox" name="type" value="管理办法" />管理办法
                <input type="checkbox" name="type" value="决定条例" />决定条例
                <input type="checkbox" name="type" value="细则解释" />细则解释
                <input type="checkbox" name="type" value="规范指南" />规范指南
            </td>
            <c:forEach items="${types}" var="type">
                <script>
                    document.querySelector("input[value=${type}]").setAttribute("checked","checked");
                </script>
            </c:forEach>
        </tr>

        <tr>
            <td colspan="4"><input type="button" value="返回" onclick="location.href='index.jsp'">
                <input type="submit" value="修改" /></td>
            <td></td>
        </tr>
    </table>
</form>
</body>
</html>
